import axios from "axios";

const request = axios.create({
    baseURL: 'http://api_devss.wanxikeji.cn',
<<<<<<< HEAD
    timeout: 20000

=======
<<<<<<< HEAD
    timeout: 20000
=======
    timeout: 5000
>>>>>>> 47b53261c8e91e7ca39280b9dc0f230d5a19dd33
>>>>>>> 36b4eaab32b312f7ed99e774a924af1f2e73a966
})

request.interceptors.request.use(config => {
    return config
}, error => {
    return Promise.reject(error)
})

<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> 36b4eaab32b312f7ed99e774a924af1f2e73a966
request.interceptors.response.use(config => {

    if (config.data.code === 3002) {
        sessionStorage.removeItem('userdata')
    }
    return config
}, error => {
<<<<<<< HEAD

=======
=======
request.interceptors.response.use(config=>{
    return config
},error => {
>>>>>>> 47b53261c8e91e7ca39280b9dc0f230d5a19dd33
>>>>>>> 36b4eaab32b312f7ed99e774a924af1f2e73a966
    return Promise.reject(error)
})

export default request